Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Xpra in desktop mode #328

Closed
wants to merge 8 commits into from
Closed

Use Xpra in desktop mode #328

wants to merge 8 commits into from

Conversation

Wuestengecko
Copy link
Member

@Wuestengecko Wuestengecko commented Oct 10, 2024

Compared to using the Xpra HTML5 client in window mode, the desktop mode features much better window management thanks to the battle-proven Openbox WM. The two most noticable improvements are:

  1. The Capella main window automatically is fullscreened, removing the unneeded window decorations and making it always follow the browser window size. This also applies to Xrdp based session, which previously had every window in fullscreen mode, including (normally small) dialogs.

  2. Modal dialogs (like the "New Project" or "Properties" dialogs) now properly stay on top of the Capella main window. Previously, they could disappear behind the main window. This avoids the awkward situations where a hidden modal dialog prevents interaction with the main window, making it appear completely frozen.

This change currently still has some unfixed issues.

  • The Capella splash screen isn't properly displayed during first start. When restarting Capella inside an established session, it does show up though.
  • When resizing the browser window too quickly, Capella sometimes gets stuck in a too large or too small size, or disappears entirely. Refreshing the tab fixes this. Acceptable limitation. Use Xpra in desktop mode #328 (comment)
  • When clicking on something, or when the cursor style changes (e.g. from normal cursor to the "resize drag" cursor), the cursor turns very large, and becomes the normal size again once moved.
  • There should be a wallpaper, but the nitrogen process which should set it crashes with SIGABRT. => The wallpaper.png file in the repo is empty, and I can't find the contents. Removed nitrogen as suggested in Use Xpra in desktop mode #328 (comment).

Resolves #317

@MoritzWeber0
Copy link
Member

Thanks @Wuestengecko and @jamilraichouni for looking into it in detail. I like the proposal to switch to OpenBox: We already have the infrastructure from xrdp and can have a consistent window manager, independent from Xpra or Xrdp.

The Capella splash screen isn't properly displayed during first start. When restarting Capella inside an established session, it does show up though.

I can remember that we had this issue with Guacamole too (where Openbox is already used currently). However, just checked it with the latest version and there I can see the splash screen (via xrdp).

When resizing the browser window too quickly, Capella sometimes gets stuck in a too large or too small size, or disappears entirely. Refreshing the tab fixes this.

This is an acceptable limitation considering the usability improvements of the PR.

There should be a wallpaper, but the nitrogen process which should set it crashes with SIGABRT. To be investigated.#

A few years (?) ago we definitely had nitrogen working to display a "fake" splash screen. However, it has not been used since then and can be removed.

@jamilraichouni
Copy link
Contributor

This change currently still has some unfixed issues.

Good morning @Wuestengecko , could you reproduce/ resolve this issue with a very big mouse cursor?

@jamilraichouni
Copy link
Contributor

jamilraichouni commented Oct 11, 2024

@Wuestengecko, add the trailer Resolves #317 to the PR description, please.

@Wuestengecko
Copy link
Member Author

Wuestengecko commented Oct 11, 2024

@Wuestengecko, add the trailer Resolves #317 to the PR description, please.

No longer needed, since it's already linked up through Github (see the sidebar on the "Conversation" tab) :)

Seems Moritz just did that instead. Regardless, you can also just do these kinds of minor edits yourself, or simply link up issues directly via the sidebar.

@Wuestengecko Wuestengecko force-pushed the xpra-desktop-mode branch 2 times, most recently from 7ffa855 to 0acb4d0 Compare October 11, 2024 14:31
@Wuestengecko Wuestengecko marked this pull request as ready for review October 11, 2024 14:34
@@ -27,7 +27,8 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco
obconf \
gettext-base \
xprintidle \
nitrogen && rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* && \
sed -i -e "/^border\.width:/ s/: .*/: 3/" /usr/share/themes/Clearlooks/openbox-3/themerc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only seems to increase the bottom border size. This looks a bit odd to me since the borders on the left and right still have the previous size. Since the left and right borders can also be used for resizing, we should check if it's feasible to increase their size (probably via theming)

remote/rc.xml Outdated
@@ -750,7 +750,7 @@

# end of the example
-->
<application name="Capella">
<application type="normal" title="workspace - Capella*">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the same rule for Papyrus and Eclipse. Even though it wasn't tracked before, we should keep it aligned and have the same behaviour between Papyrus, Eclipse & Capella.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing: Does the session sharing in the Capella Collaboration Manager still work as expected? How does it behave with different screen sizes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing: Does the internal session viewer in the Capella Collaboration Manager still work as expected?

Copy link
Member

@MoritzWeber0 MoritzWeber0 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires testing in the staging environment: How is the general connectivity? Reordering of a popup seems to cause more traffic since there is no window scoping anymore on the client side

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browser zoom in doesn't scale the window anymore. Needs more investigation, probably we can't do much about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zooming in and out does work for me, but only via the browser menu, as Ctrl+Scroll gets captured and sent to X. However it seems to suffer from the same issue as resizing quickly. Reloading fixes this as well, after which the Capella window is simply rendered larger (and blurry if zooming in, but that's expected on X).

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

[program:xpra]
command=xpra start :10 --start=/home/techuser/.config/openbox/autostart --start-env=GTK_IM_MODULE=ibus --attach=yes --daemon=no --bind-tcp=0.0.0.0:10001 --min-quality=70
command=xpra start-desktop :10 --start=/usr/local/bin/openbox-launcher.sh --attach=yes --daemon=no --bind-tcp=0.0.0.0:10001 --min-quality=70
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since openbox-launcher is now used as startup command, the favicon and title of the Tab in Chrome relate to "Openbox". It would be nice to still see the window title - or at least the text "Capella".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this, but it doesn't seem like there's an easy win here. We could try to hard-code the title "Capella" in the HTML/JS files somehow, but it gets set dynamically after connecting, so this doesn't exactly sound trivial.

@Wuestengecko Wuestengecko force-pushed the xpra-desktop-mode branch 2 times, most recently from 35594f1 to 9b1ccfc Compare October 16, 2024 14:39
@jamilraichouni
Copy link
Contributor

Wow, when I look at the activity here, this one is bigger than initially expected.

Compared to using the Xpra HTML5 client in window mode, the desktop mode
features much better window management thanks to the battle-proven
Openbox WM. The two most noticable improvements are:

1. The Capella main window automatically is fullscreened, removing the
   unneeded window decorations and making it always follow the browser
   window size, just like for Xrdp based sessions.

2. Modal dialogs (like the "New Project" or "Properties" dialogs) now
   properly stay on top of the Capella main window. Previously, they
   could disappear behind the main window. This avoids the awkward
   situations where a hidden modal dialog prevents interaction with the
   main window, making it appear completely frozen.

The Xvfb instance spawned by Xpra is configured to use 96 DPI. This
avoid issues with Openbox seeing a way too high resolution during early
startup, before the client has connected, and assuming a HighDPI
display. Scaling is actually done client-side by the browser (by
reporting a downscaled resolution to Xpra), and Openbox applying its own
scaling settings would result in irritating issues like oversized mouse
cursors.

Setting the DPI happens in a small wrapper script, which is called by
Xpra instead of the actual `openbox-session` executable. This allows the
setting to be applied early enough to also affect Openbox itself,
instead of only the Capella instance started by its autostart script.
It hasn't been working for a while anyways. (This might have to do with
the wallpaper file being empty.)
The default border size of 1px can be very hard to grab, in case a
floating window has to be resized.
It looks a bit more modern, and simly looks better with the thicker
window borders.
This is a simple and pragmatic solution to the splash spawning outside
of the viewport before the first connection.
@MoritzWeber0
Copy link
Member

MoritzWeber0 commented Oct 17, 2024

#334 seems to do the job and has a smaller chance of potential other implications. This PR contains many interesting improvements for Guacamole though. @Wuestengecko can you create new PRs to include the following changes?

  • Remove nitrogen
  • Append to /etc/environment in provisioning.py
  • Theme change to Natura and maximize icon
  • Only show the main Capella window in fullscreen
  • --input-method=keep

@Wuestengecko Wuestengecko deleted the xpra-desktop-mode branch October 17, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal dialogs disappear in the background
3 participants